//
//  Sprite.h
//  MapEdit
//
//  Created by Steven Canfield on 26/06/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "ColorPalette.h"
#import "PCXFile.h"

#define NUM_COLORS 12

@interface Sprite : NSObject {
	NSData * grpData;
	NSMutableArray ** bitmaps;
	
	u_int16_t	boundsWidth;
	u_int16_t	boundsHeight;
	
	u_int8_t * offsetX;
	u_int8_t * offsetY;
	
	u_int8_t *	frameWidth;
	u_int8_t *	frameHeight;
	
	u_int16_t	frameCount;
}

+ (void)setUnitPalette:(ColorPalette *)cp;
+ (void)setPlayerPalette:(PCXFile *)pp;
- (id)initWithData:(NSData *)data;
- (NSBitmapImageRep *)frameAtIndex:(int)index owner:(int)owner;

- (int)boundingWidth;
- (int)boundingHeight;

- (int)widthForFrame:(int)index;
- (int)heightForFrame:(int)index;

- (int)horizOffsetForFrame:(int)index;
- (int)verticalOffsetForFrame:(int)index;
- (int)frameCount;

- (BOOL)hitTest:(NSPoint)point;
@end
